function shuffle_simple(arr) {  //概率分布不均
    return arr.sort(() =>
        Math.random() - .5
    )
}

//o(n)
function shuffle_pro(arr) {
    for (let i = 0; i < arr.length - 1; i++) {
        const j = i + Math.floor(Math.random() * (arr.length - i));
        [arr[i], arr[j]] = [arr[j], arr[i]]
    }
    return arr
}



function shuffle(arr) {
    const m = []
    const N = arr.length * arr.length * arr.length
    for (let i = 0; i < arr.length - 1; i++) {
        m[i] = Math.floor(Math.random(1, N))
    }
    return arr.sort((i, j) => m[i] - m[j])
}
let a = shuffle([1, 2, 3, 4])
console.log(a)